package com.ymatou.iapi.captcha.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.captcha.parameter.*;
import com.ymatou.iapi.captcha.service.*;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.ValidateCodeServiceV2;
import com.ymttest.database.model.ValidationCode;
import com.ymttest.database.model.YmtValidationCode;
import com.ymttest.database.sqlwapper.YmtValidationCodeWapperV2;
import com.ymttest.utils.TestDataManager;
/**
*校验验证码用例
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ConfirmValidateCode{
	private static ConfirmValidateCodeBean confirmvalidatecodeBean;
	private static ConfirmValidateCodeCall confirmvalidatecodeCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("校验验证码用例");
	}

	@Before
	public void caseUp() {
		confirmvalidatecodeBean=new ConfirmValidateCodeBean();
		confirmvalidatecodeCall=new ConfirmValidateCodeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(confirmvalidatecodeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_001() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, 640, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("200", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_002() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度<32-验证码格式错误");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 20,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("600", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyIsContains("验证码格式错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");			
			
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_003() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码已验证过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			confirmvalidatecodeCall = new ConfirmValidateCodeCall();
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			Logger.verifyEquals("500", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("已验证过", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(500, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_004() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码错误");
		try {
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setValidateCode("1234567890123456789012345678901234567890");
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();		
			
			Logger.verifyEquals("100", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_005() {
		Logger.start(true,"校验验证码-验证主体为非空-验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("200", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_006() {
		Logger.start(true,"校验验证码-验证主体为非空-验证码已验证过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			confirmvalidatecodeCall = new ConfirmValidateCodeCall();
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			Logger.verifyEquals("500", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("已验证过", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(500, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_007 () {
		Logger.start(true,"校验验证码-验证主体为非空-验证码错误");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode("123");
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			Logger.verifyEquals("100", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_008() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码已失效");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			new YmtValidationCodeWapperV2().setiValidateStatus(getValidateCodeCall.getValidateCode(), -1);
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("300", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(-1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(300, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_009() {
		Logger.start(true,"校验验证码-验证主体为非空，-验证码已失效");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			new YmtValidationCodeWapperV2().setiValidateStatus(getValidateCodeCall.getValidateCode(), -1);
			
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("300", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(-1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(300, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCode_010 () {
		Logger.start(true,"校验验证码-验证主体为非空-验证码验证错误-400");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();
			
			Logger.verifyEquals("400", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyIsContains("错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_011() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码空-400");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmvalidatecodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("400", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyIsContains("验证验证码错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_012() {
		Logger.start(true,"校验验证码-type-1000验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmvalidatecodeBean.setValidateType(-1000);
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("200", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(confirmvalidatecodeBean.getActionUser(),confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCode_013() {
		Logger.start(true,"校验验证码-type-1000验证码输入错误,失败");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			confirmvalidatecodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmvalidatecodeBean.setValidateCode(getValidateCodeCall.getValidateCode()+1);
			confirmvalidatecodeBean.setValidateType(-1000);
			
			confirmvalidatecodeCall.setData(confirmvalidatecodeBean);
			confirmvalidatecodeCall.callService();

			Logger.verifyEquals("100", confirmvalidatecodeCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码错误", confirmvalidatecodeCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", confirmvalidatecodeCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(confirmvalidatecodeBean.getActionUser(),confirmvalidatecodeCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}